Adaptor = class('Adaptor')
function Adaptor:BindProperty(propertyName, binder)
    self.view = binder.view
    self.binder = binder
    self.adaptorID = binder:Add(propertyName, function(oldValue, newValue)
        xpcall(function()
            self:OnViewModelValueChanged(oldValue, newValue)
        end,function(errmsg)
            logError(errmsg)
        end)
    end)
end

function Adaptor:Trigger()
    self.binder:Trigger(self.adaptorID)
end

function Adaptor:OnViewModelValueChanged(oldValue, newValue) end
function Adaptor:OnAdd(viewModel) end
function Adaptor:OnInsert(index, viewModel) end
function Adaptor:OnRemove(index) end